package com.hanlin.beforejavacodesummary.common;


public class Result<T> {
    private String message;
    private Integer code;
    private T object;

    public T getObject() {
        return object;
    }

    public void setObject(T object) {
        this.object = object;
    }

    public Result(String message, Integer code, T object) {
        this.message = message;
        this.code = code;
        this.object = object;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }
    public static  Result success(Object object){
       return new Result("成功",200,object);
    }

    public static Result error(){
        return new Result("操作失败",500,null);
    }
}
